<#include "../common/layout/__mainlayout.html">
    <#include "../common/__pagination.html">

        <!--设置面包屑-->
        <#assign pageBreadCrumbs>
            <li class="active"><a href="#">专题管理</a></li>
            <li class="active">专题软件选择</li>
        </#assign>
        <#assign pageCss>
            <!-- page specific plugin styles -->
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/jquery-ui.custom.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/chosen.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/datepicker.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/daterangepicker.css"/>
        </#assign>

        <#assign pageJavascript>
            <script type="text/javascript">
                $(document).ready(function () {
                    $('[data-rel=tooltip]').tooltip();

                    if (!ace.vars['touch']) {
                        $('.chosen-select').chosen({allow_single_deselect: true});
                    }

                    // 清除远程modal数据
                    $("#editModal").on("hidden.bs.modal", function () {
                        $(this).removeData("bs.modal");
                    });

                    //初始化范围选择器
                    $('input[name=createTimeRange]').daterangepicker({
                        'applyClass': 'btn-sm btn-success',
                        'cancelClass': 'btn-sm btn-default',
                        locale: {
                            applyLabel: '确定',
                            cancelLabel: '取消'
                        }
                    })

                    //初始化范围选择器
                    $('input[name=startTimeRange]').daterangepicker({
                        'applyClass': 'btn-sm btn-success',
                        'cancelClass': 'btn-sm btn-default',
                        locale: {
                            applyLabel: '确定',
                            cancelLabel: '取消'
                        }
                    })
                });
            </script>
        </#assign>

        <@mainlayout pageBreadCrumbs=pageBreadCrumbs pageCss=pageCss pageJavascript=pageJavascript
        currentMenu="topicFlag-topicListFlag">
        <div class="row">
            <div class="col-xs-12">
                <form id="searchForm" class="form-search form-inline">
                    <div class="row">
                        <div class="widget-body">
                            <div class="widget-main">
                                <div class="form-group  col-xs-12" style="padding-top:10px">
                                    <div class="form-group">
                                        <label>软件名称:</label>
                                        <input class="form-control" type="text" placeholder="请输入软件名" size="50" name="softName" id="softName"     maxlength="50">
                                    </div>
                                    <div class="form-group">
                                        <a href="#" class="tooltip-warning searchSoft" data-rel="tooltip" title="搜索"  data="${softName!}"><span  class="label label-warning">搜索</span></a>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </form>
                <table id="topicTable" class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th width="40" align="center">软件编号</th>
                        <th width="100" align="left">软件名称</th>
                        <th width="270" align="left">介绍</th>
                        <th width="160" align="left">状态</th>
                        <th width="130" align="center">开始时间-结束时间</th>
                        <th width="70" align="center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#list topicPage.listData as topic>
                        <tr>
                            <td>${topic.id!}</td>
                            <td>${topic.topicName!}</td>
                            <td>${topic.summary!}</td>
                            <td>
                                <#if topic.state == 0>
                                    隐藏
                                    <#elseif   topic.state = 1>
                                        显示
                                        <#elseif  topic.state = -1>
                                            删除
                                            <#else>
                                </#if>
                            </td>
                            <td>
                                <#if topic.createTime!??>${topic.createTime?string("yyyy-MM-dd")!}
                                    <#else>
                                        无
                                </#if>
                                -
                                <#if topic.expiredTime!??>${topic.expiredTime?string("yyyy-MM-dd")!}
                                    <#else>
                                        无
                                </#if>
                            </td>
                            <td>
                                <div class="hidden-sm hidden-xs action-buttons">
                                    <a class="green tooltip-success edit"
                                       href="${ctx}/admin/topic/viewTopic.do?topicId=${topic.id!}" data-rel="tooltip"
                                       title="修改" data-toggle="modal" data-target="#editModal"><span
                                            class="label label-success">修改</span></a>
                                    <a class="red tooltip-error delete"
                                       href="${ctx}/admin/topic/deleteTopic.do?topicId=${topic.id!}" data-rel="tooltip"
                                       title="删除"> <span class="label label-danger">删除</span></a>
                                    <a class="green tooltip-success edit"
                                       href="${ctx}/admin/topic/viewTopicSoftMap.do" class="tooltip"
                                       data-rel="tooltip" title="挑选软件">
                                        <span class="label label-warning">挑选软件</span></a>
                                </div>
                                <div class="hidden-md hidden-lg">
                                    <div class="inline position-relative">
                                        <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown"
                                                data-position="auto">
                                            <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
                                        </button>
                                        <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
                                            <li><a href="${ctx}/admin/topic/viewTopic.do?topicId=${topic.id!}"
                                                   class="tooltip-success edit" data-rel="tooltip" title="编辑"
                                                   data-toggle="modal" data-target="#editModal"><span
                                                    class="label label-success">修改</span></a></li>
                                            <li><a href="${ctx}/admin/topic/deleteTopic.do?topicId=${topic.id!}"
                                                   class="tooltip-error delete" data-rel="tooltip" title="删除"> <span
                                                    class="label label-danger">删除</span></a></li>
                                            <li><a href="${ctx}/admin/topic/viewTopicSoftMap.do" class="tooltip-warning"
                                                   data-rel="tooltip" title="挑选软件"> <span class="label label-warning">挑选软件</span></a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </#list>
                    </tbody>
                </table>
                <@pagination topicPage!/>
            </div>
        </div>

        <div id="editModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                </div>
            </div>
        </div>
    </@mainlayout>